﻿using System;
using System.Collections.Generic;
using System.Web.Mvc;

namespace TfsReports.Web.Extensions
{
    /// <summary>
    /// NoTempDataProvider
    /// </summary>
    public class NoTempDataProvider : ITempDataProvider
    {
        /// <summary>
        /// Loads the temporary data.
        /// </summary>
        /// <param name="controllerContext">The controller context.</param>
        /// <returns>The temporary data.</returns>
        public IDictionary<string, object> LoadTempData(ControllerContext controllerContext)
        {
            return new Dictionary<string, object>();
        }

        /// <summary>
        /// Saves the temporary data.
        /// </summary>
        /// <param name="controllerContext">The controller context.</param>
        /// <param name="values">The values.</param>
        public void SaveTempData(ControllerContext controllerContext, IDictionary<string, object> values)
        {
            if (values.Count != 0)
                throw new NotImplementedException("Can not set tempdata, no session state available");
        }
    }
}